package com.sina.shop.util;

import java.time.LocalDate;
import java.time.format.DateTimeFormatter;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * 段浩杰   2017-11-22-11:13
 */
public class DateUtils {

    public static String LocalDateFormatter(String pattern) {
        String result;
        LocalDate localDate = LocalDate.now();
        if (StringUtils.isEmpty(pattern)) {
            result = localDate.toString();
        } else {
            DateTimeFormatter df = DateTimeFormatter.ofPattern(pattern);
            result = df.format(localDate);
        }
        return result;
    }
}
